package com.service;

import com.dto.AdvertiseDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

/**
 * Created with IntelliJ IDEA.
 * User: nkrivko
 * Date: 28.04.14
 * Time: 15:59
 * To change this template use File | Settings | File Templates.
 */
@Service
public class IndexService {

    @Autowired
    private RedisTemplate<String, String> template;

    public AdvertiseDTO search(){
//        template.opsForHash().put("key","key".hashCode(),"+7-963-301-59-23");

        AdvertiseDTO advertiseDTO = new AdvertiseDTO();
        String key = (String) template.opsForHash().get("key", "key".hashCode());
        advertiseDTO.setPhone(key);
        return advertiseDTO;
    }
}
